Here's a small CGI program to calculate the expected value of the remaining cases on the TV show Deal or No Deal (Oh, and the all important screen shot).
#!/usr/bin/perl
use CGI;
$q = new CGI;
print $q->header;
print $q->start_html(-title=>'Deal or No Deal',-BGCOLOR=>'white'),
$q->h1('--Deal or No Deal--'),
$q->startform();
@left = qw/ 0.01 1 5 10 20 50
75 100 200 300 400 500 750 /;
@right= qw/1,000 5,000 10,000 25,000 50,000 75,000
100,000 200,000 300,000 400,000 500,000 750,000 1,000,000/;
my $i = 0;
print "Expected Value: ".'$'; printf "%.2f
Re:Too simple perhaps?
Greg Buchholz on 2006-03-12T05:06:15
Is there a specific critique you have in mind? Did I screw up the calculation for expected value somehow?